<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>{$lang.home}{if $ur_here} - {$ur_here} {/if}</title>
<meta name="Copyright" content="Douco Design." />
<link href="templates/public.css" rel="stylesheet" type="text/css">
{include file="javascript.htm"}
</head>
<body>
<div id="dcWrap">
 {include file="header.htm"}
 <div id="dcLeft">{include file="menu.htm"}</div>
 <div id="dcMain">
   {include file="ur_here.htm"}
   <div id="user" class="mainBox" style="{$workspace.height}">
    <h3><a href="{$useradd_link.href}" class="actionBtn add">{$useradd_link.text}</a>&nbsp;<a href="{$userlist_link.href}" class="actionBtn">{$userlist_link.text}</a>&nbsp;<a href="{$userapply_link.href}" class="actionBtn">{$userapply_link.text}</a>{$ur_here}</h3>


    <!-- {if $rec eq 'default'} 会员列表 -->
    <div class="filter">
      <form action="user.php" method="post">
        <input name="user_name" class="inpMain" placeholder="输入用户名" value="" size="20" type="text">
        <input name="mobile" class="inpMain" placeholder="手机号" value="" size="20" type="text">
        <input name="submit" class="btnGray" value="查询" type="submit">
      </form>
    </div>
    <table width="100%" border="0" cellpadding="8" cellspacing="0" class="tableBasic">
     <tr>
      <th width="30" align="center">{$lang.record_id}</th>
      <th align="center">{$lang.user_username}</th>
      <th align="center">{$lang.user_nickname}</th>
      <th align="center">{$lang.user_type}</th>
      <th align="center">{$lang.user_email}</th>
      <th align="center">{$lang.user_mobile}</th>
      <th align="center">{$lang.user_level}</th>
      <th align="center">{$lang.user_balance}</th>
      <th align="center">{$lang.user_add_time}</th>
      <th align="center">{$lang.user_last_login}</th>
      <th align="center">{$lang.handler}</th>
     </tr>
     <!-- {foreach from=$user_list item=user_list} -->
     <tr>
      <td align="center">{$user_list.user_id}</td>
      <td align="center">{$user_list.user_name}</td>
      <td align="center">{$user_list.nick_name}</td>
      <td align="center">{$lang.user_type_or[$user_list.user_type]}</td>
      <td align="center">{$user_list.email}</td>
      <td align="center">{$user_list.mobile}</td>
      <td align="center">{$user_list.level}</td>
      <td align="center">{$user_list.balance}</td>
      <td align="center">{$user_list.add_time}</td>
      <td align="center">{$user_list.last_login}</td>
      <td align="center">
        <a href="user.php?rec=edit&id={$user_list.user_id}">{$lang.edit}</a> | 
        <a href="user.php?rec=del&id={$user_list.user_id}">{$lang.del}</a> | 
        <a href="user.php?rec=user_address&id={$user_list.user_id}">{$lang.address}</a> |
        <a href="order.php?user_id={$user_list.user_id}">{$lang.user_order}</a></td>
     </tr>
     <!-- {/foreach} -->
    </table>
    <!-- {/if} -->
    
    <!-- {if $rec eq 'edit' || $rec eq 'add'} 会员编辑 -->
    <form action="user.php?rec={if $rec eq 'edit'}update{else}insert{/if}" method="post">
     <table width="100%" border="0" cellpadding="8" cellspacing="0" class="tableBasic">
      <tr>
       <td width="100" align="right">{$lang.user_username}</td>
       <td>
        <input type="text" name="user_name" value="{$user_info.user_name}" size="40" class="inpMain" {if $user.action_list neq 'ALL'}readonly="true"{/if}/>
       </td>
      </tr>
      <tr>
       <td width="100" align="right">{$lang.user_nickname}</td>
       <td>
        <input type="text" name="email" value="{$user_info.nick_name}" size="40" class="inpMain" />
       </td>
      </tr>
      <tr>
       <td width="100" align="right">{$lang.sex}</td>
       <td>
        <select name="sex">
          <option value="0" {if $user_info.sex eq '0'}selected=selected{/if}>女</option>
          <option value="1" {if $user_info.sex eq '1'}selected=selected{/if}>男</option>
        </select>
       </td>
      </tr>
      <tr>
       <td width="100" align="right">{$lang.user_type}</td>
       <td>
        <select name="user_type">
          <option value="0" {if $user_info.user_type eq '0'}selected=selected{/if}>{$lang.user_type_or[0]}</option>
          <option value="1" {if $user_info.user_type eq '1'}selected=selected{/if}>{$lang.user_type_or[1]}</option>
        </select>
       </td>
      </tr>
      <tr>
       <td width="100" align="right">{$lang.user_email}</td>
       <td>
        <input type="text" name="email" value="{$user_info.email}" size="40" class="inpMain" />
       </td>
      </tr>
      <tr>
       <td width="100" align="right">{$lang.user_mobile}</td>
       <td>
        <input type="text" name="mobile" value="{$user_info.mobile}" size="40" class="inpMain" />
       </td>
      </tr>
      <tr>
       <td width="100" align="right">{$lang.user_level}</td>
       <td>
        <input type="text" name="level" value="{$user_info.level}" size="40" class="inpMain" />
       </td>
      </tr>
      <tr>
       <td width="100" align="right">{$lang.user_balance}</td>
       <td>
        <input type="text" {if $rec eq 'edit'}disabled="disabled"{/if} name="balance" value="{$user_info.balance}" size="40" class="inpMain" /> <input type="text" name="add_balance" placeholder="充值余额" size="15" class="inpMain" />
       </td>
      </tr>
      <tr>
       <td width="100" align="right">{$lang.invoice_title}</td>
       <td>
        <input type="text" name="level" value="{$user_info.invoice_title}" size="40" class="inpMain" />
       </td>
      </tr>
      <!-- {if $if_check} -->
      <tr>
       <td align="right">{$lang.user_old_password}</td>
       <td>
        <input type="password" name="old_password" size="40" class="inpMain" />
       </td>
      </tr>
      <!-- {/if} -->
      <tr>
       <td align="right">{$lang.user_new_password}</td>
       <td>
        <input type="password" name="password" size="40" class="inpMain" />
       </td>
      </tr>
      <tr>
       <td align="right">{$lang.user_new_password_confirm}</td>
       <td>
        <input type="password" name="password_confirm" size="40" class="inpMain" />
       </td>
      </tr>
      <tr>
       <td></td>
       <td>
        <input type="hidden" name="token" value="{$token}" />
        <input type="hidden" name="id" value="{$user_info.user_id}" />
        <input type="submit" name="submit" class="btn" value="{$lang.btn_submit}" />
       </td>
      </tr>
     </table>
    </form>
    <!-- {/if} -->

    <!-- {if $rec eq 'user_address'} 收货地址 -->
    <table width="100%" border="0" cellpadding="8" cellspacing="0" class="tableBasic">
     <tr>
      <th width="30" align="center">{$lang.record_id}</th>
      <th width="50" align="left">{$lang.consignee}</th>
      <th width="50" align="left">{$lang.mobile}</th>
      <th width="150" align="center">{$lang.address}</th>
      <th width="20" align="center">{$lang.default_address}</th>
     </tr>
     <!-- {foreach from=$address_list item=address_list} -->
     <tr>
      <td align="center">{$address_list.id}</td>
      <td>{$address_list.consignee}</td>
      <td>{$address_list.mobile}</td>
      <td align="center">{$address_list.address_info.province}{$address_list.address_info.city}{$address_list.address_info.area}{$address_list.address}</td>
      <td align="center">{if $address_list.default eq 1}是{else}否{/if}</td>
     </tr>
     <!-- {/foreach} -->
    </table>
    <!-- {/if} -->


    <!-- {if $rec eq 'apply'} 会员申请列表 -->
    <table width="100%" border="0" cellpadding="8" cellspacing="0" class="tableBasic">
     <tr>
      <th width="30" align="center">{$lang.record_id}</th>
      <th align="center">{$lang.city}</th>
      <th align="center">{$lang.contact}</th>
      <th align="center">{$lang.mobile}</th>
      <th align="center">{$lang.diner_num}</th>
      <th align="center">{$lang.email}</th>
      <th align="center">{$lang.address}</th>
      <th align="center">{$lang.state}</th>
      <th align="center">{$lang.handler}</th>
     </tr>
     <!-- {foreach from=$apply_list item=apply} -->
     <tr>
      <td align="center">{$apply.id}</td>
      <td align="center">{$apply.city}</td>
      <td align="center">{$apply.contact}</td>
      <td align="center">{$apply.mobile}</td>
      <td align="center">{$apply.diner_num}</td>
      <td align="center">{$apply.email}</td>
      <td align="center">{$apply.address}</td>
      <td align="center">{$lang.apply_state[$apply.state]}</td>
      <td align="center">
        <a href="user.php?rec=update_apply_state&id={$apply.id}">已处理</a> | 
        <a href="user.php?rec=add&mobile={$apply.mobile}&email={$apply.email}">{$lang.user_add}</a>
      </td>
     </tr>
     <!-- {/foreach} -->
    </table>
    {include file="pager.htm"}
    <!-- {/if} -->


   </div>
 </div>
 {include file="footer.htm"}
 </div>
</body>
</html>